/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.hanhpt.btvn1;

import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Bai2M1 
{
    public static void main(String[] args) 
    {
        Scanner sc=new Scanner(System.in);
        System.out.println("nhap vao so thu nhat");
        int a=sc.nextInt();
        System.out.println("nhap so thu 2");
        int b=sc.nextInt();
        // tim uoc chung lon nhat
        int ucln=0;
        for(int i=1;i<=a;i++)
        {
            double x=a%i;
            double y=b%i;
            if(x==0&&y==0)
            {
                ucln=i;
            }
        }
        System.out.println("uoc chung lon nhat cua 2 so a b la " + ucln);
    }
}
